package xyz.jcat.seata.example.order.service;

import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;
import xyz.jcat.mybatis.IService;
import xyz.jcat.seata.example.api.dto.SaleDto;
import xyz.jcat.seata.example.order.domain.po.OrderPo;

/**
 *
 * @author yueyue
 * auto on 2022-03-16 00:43:38
 */
@LocalTCC
public interface IOrderService extends IService<OrderPo> {

    @TwoPhaseBusinessAction(
            name = "addOrder",
            commitMethod = "addOrderCommit",
            rollbackMethod = "addOrderRollback"
    )
    void addOrder(@BusinessActionContextParameter(paramName = "order") OrderPo order);

    boolean addOrderCommit(BusinessActionContext context);

    boolean addOrderRollback(BusinessActionContext context);

    Long getOrderId();
}
